using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using 畜牧业审核程序国产.Models;

namespace 畜牧业审核程序国产;

public partial class UserInformation : Window
{
    private SettingManager _settingManager;
    public UserInformation()
    {
        InitializeComponent();
        _settingManager = new SettingManager();
        this.Closing += OnClosing;
    }
    private void OnClosing(object? sender, WindowClosingEventArgs e)
    {
        _settingManager.UpdateAccountInfo(this.txt国网用户名.Text, this.txt国网密码.Text,
                       this.txt省网用户名.Text, this.txt省网密码.Text, this.txt统计云用户名.Text
            , this.txt统计云密码.Text);
        _settingManager.SaveSettings();
    }
}